/*
 * Copyright 2012 Marsrutai.lt
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package lt.marsrutai.mobile.android.activity.intent;

import java.util.List;

import lt.marsrutai.mobile.android.activity.StopsActivity;
import lt.marsrutai.mobile.android.model.Stop;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class StopsIntentHolder extends IntentHolder {

    private static final String SCOPE_FOLDER = "scopeFolder";
    private static final String SCOPE_NAME = "scopeName";

    private static final String TRANSPORT_ID = "transportId";

    private static final String SCHEDULE_ID = "scheduleId";
    private static final String SCHEDULE_NAME = "scheduleName";
    private static final String SCHEDULE_TRACK_NAME = "scheduleTrackName";

    private static final String TRACK_ID = "trackId";
    private static final String TRACK_NAME = "trackName";
    
    private static final String STOPS = "stops";

    public StopsIntentHolder(Activity sourceActivity) {
        super(sourceActivity, StopsActivity.class);
    }
    
    public StopsIntentHolder(Activity sourceActivity,
            String scopeFolder, String scopeName, String transportId, String scheduleId, String scheduleName, String scheduleTrackName, String trackId, String trackName) {
        super(sourceActivity, StopsActivity.class);
        this.setScopeFolder(scopeFolder);
        this.setScopeName(scopeName);
        this.setTransportId(transportId);
        this.setScheduleId(scheduleId);
        this.setScheduleName(scheduleName);
        this.setScheduleTrackName(scheduleTrackName);        
        this.setTrackId(trackId);
        this.setTrackName(trackName);
    }    

    public StopsIntentHolder(Intent intent) {
        super(intent);
    }

    public StopsIntentHolder(Bundle budnle) {
        super(budnle);
    }

    public void setScopeFolder(String scopeFolder) {
        intent.putExtra(SCOPE_FOLDER, scopeFolder);
    }

    public String getScopeFolder() {
        return intent.getStringExtra(SCOPE_FOLDER);
    }

    public void setScopeName(String scopeName) {
        intent.putExtra(SCOPE_NAME, scopeName);
    }

    public String getScopeName() {
        return intent.getStringExtra(SCOPE_NAME);
    }

    public void setTransportId(String transportId) {
        intent.putExtra(TRANSPORT_ID, transportId);
    }

    public String getTransportId() {
        return intent.getStringExtra(TRANSPORT_ID);
    }

    public void setScheduleId(String scheduleId) {
        intent.putExtra(SCHEDULE_ID, scheduleId);
    }

    public String getScheduleId() {
        return intent.getStringExtra(SCHEDULE_ID);
    }

    public void setScheduleName(String scheduleName) {
        intent.putExtra(SCHEDULE_NAME, scheduleName);
    }

    public String getScheduleName() {
        return intent.getStringExtra(SCHEDULE_NAME);
    }

    public void setScheduleTrackName(String scheduleTrackName) {
        intent.putExtra(SCHEDULE_TRACK_NAME, scheduleTrackName);
    }

    public String getScheduleTrackName() {
        return intent.getStringExtra(SCHEDULE_TRACK_NAME);
    }

    public void setTrackId(String trackId) {
        intent.putExtra(TRACK_ID, trackId);
    }

    public String getTrackId() {
        return intent.getStringExtra(TRACK_ID);
    }

    public void setTrackName(String trackName) {
        intent.putExtra(TRACK_NAME, trackName);
    }

    public String getTrackName() {
        return intent.getStringExtra(TRACK_NAME);
    }

    public List<Stop> getStops() {
        return getList(STOPS);
    }

    public void setStops(List<Stop> stops) {
        setCollection(STOPS, stops, Stop.class);
    }

}
